package com.yanqu.road.server.cmd.activity.qixi;

import com.google.protobuf.InvalidProtocolBufferException;
import com.yanqu.road.pb.activity.QixiProto;
import com.yanqu.road.pb.syncMessage.SyncMessage;
import com.yanqu.road.server.game.service.IGameServiceCommand;
import com.yanqu.road.server.manger.activity.qixi.QixiMgr;
import com.yanqu.road.sync.message.SyncResponse;

public class QixiRelationTopGetListServiceCmd implements IGameServiceCommand {

    @Override
    public SyncResponse execute(SyncMessage.Request request) throws InvalidProtocolBufferException {
        SyncResponse syncResponse = new SyncResponse();
        QixiProto.QixiRelationTopGetListReqMsg reqMsg = QixiProto.QixiRelationTopGetListReqMsg.parseFrom(request.getDataBytes());
        QixiProto.QixiRelationTopGetListRespMsg.Builder builder = QixiMgr.getRelationList(reqMsg.getTargetUserId(), reqMsg.getServerId(), reqMsg.getActivityId());
        syncResponse.setResponseBuilder(builder);
        return syncResponse;
    }
}
